home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2264 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.6 KB  |  47 lines

  1. Path: rover.ucs.ualberta.ca!mcbride
  2. From: mcbride@ee.ualberta.ca (Darin McBride)
  3. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  4. Subject: Re: Hungarian notation
  5. Date: 16 Jan 1996 19:53:50 GMT
  6. Organization: University of Alberta Electrical Engineering Department
  7. Message-ID: <4dgvoe$10si@pulp.ucs.ualberta.ca>
  8. References: <cmanDK7x13.5KM@netcom.com>
  9. NNTP-Posting-Host: hp02.ee.ualberta.ca
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Mike Austin (cman@netcom.com) wrote:
  13. > 3ga$80a@beatty.slip.netcom.com> <30DC677A.5116@zeta.org.au> <4bhf24$adq@beatty.slip.netcom.com> <30E0E51A.5A4F@zeta.org.au>
  14. > Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  15.  
  16. > I'm sorry to butt in, but I've found that prefixing variables with their 
  17. > scope is much more usable than their type.  For example:
  18.  
  19. > int    gGlobal;
  20. > int    sStatic;
  21. > int    mMember;
  22. > int    aArgument;
  23. > int    vVolitile;
  24.  
  25. > Var = mVar = aVar;
  26.  
  27. > Don't know if anyone else does this, but if you ever get lost in code, 
  28. > you will know where these variables are declared.
  29.  
  30. We use a similar method, although we combine the two forms.  For
  31. example:
  32.  
  33. int g_nGlobal;
  34. char* m_pszMember;
  35.  
  36. etc.  For local variables, we omit the prefix because most variables end
  37. up being local.
  38.  
  39. --
  40. Darin McBride:mcbride@ee.ualberta.ca/mcbride@tower.bohica.net
  41.  
  42. Enjoy each day as if it were your last, care about each moment as if
  43. it were your last for one day, one moment, you *will* be right!
  44.  
  45. Tips & Tricks for IBM Hardware, MSDOS, OS2, Windows (including Win'95):
  46.     http://www.ee.ualberta.ca/~mcbride/tiptrick.html
  47.